home *** CD-ROM | disk | FTP | other *** search
/ The Programmer Disk / The Programmer Disk (Microforum).iso / xpro / extra / pro13 / lseek.c < prev    next >
Text File  |  1993-02-09  |  368b  |  26 lines

  1. /*
  2.     lseek.C
  3.  
  4.     Copyright (C) 1993, Geoff Friesen B.Sc.
  5.     All rights reserved.
  6. */
  7.  
  8. #define    INCL_LSEEK
  9.  
  10. long lseek (int handle, long offset, int fromwhere)
  11. {
  12.    asm mov ah, 42h
  13.    asm mov al, fromwhere
  14.    asm mov bx, handle
  15.    asm mov cx, offset [2]
  16.    asm mov dx, offset
  17.    asm int 21h
  18.  
  19.    asm jnc lseek1
  20.  
  21.    asm mov ax, -1
  22.    asm cwd
  23.  
  24. lseek1:
  25.  
  26. }